package com.yunji.cabinet.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yunji.cabinet.dao.IContainerCycleDao;
import com.yunji.cabinet.domain.CabinetCycleDO;
import com.yunji.cabinet.dto.CabinetCycleDTO;
import com.yunji.cabinet.mapper.ICabinetCycleMapper;
import com.yunji.common.base.BaseDaoImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author : peter-zhu
 * @date : 2024/10/31 17:34
 * @description : TODO
 **/
@Repository
public class ContainerCycleDaoImpl extends BaseDaoImpl<ICabinetCycleMapper, CabinetCycleDO> implements IContainerCycleDao {
    @Override
    public List<CabinetCycleDO> cyclePageList(CabinetCycleDTO pageParam) {
        return pageList(pageParam, new LambdaQueryWrapper<CabinetCycleDO>().eq(CabinetCycleDO::getContainerId,
                pageParam.getContainerId()).eq(CabinetCycleDO::getCycleType, pageParam.getCycleType()).orderByDesc(CabinetCycleDO::getCreateTime));
    }
}